<template>
  <div style="height:100%;overflow-y:auto">
    <Card>
        <Row style="text-align: center;">
            <h1>卡牛房贷数据</h1>
        </Row>
        <Collapse v-model="value1">
            <Panel name="1">
                基本信息
                <div slot="content">
                    <Form :label-width="120" inline>
                        <FormItem label="卡号" prop="">
                            <Input placeholder="" v-model="key.bankCardNo" readonly></Input>
                        </FormItem>
                        <FormItem label="银行编码" prop="">
                            <Input placeholder="" v-model="key.bankCode" readonly></Input>
                        </FormItem>
                        <FormItem label="登陆名" prop="">
                            <Input placeholder="" v-model="key.loginName" readonly></Input>
                        </FormItem>
                        <FormItem label="银行名称" prop="">
                            <Input placeholder="" v-model="key.bankName" readonly></Input>
                        </FormItem>
                        <FormItem label="卡类型" prop="">
                            <Input placeholder="" v-model="key.cardType" readonly></Input>
                        </FormItem>
                        <FormItem label="币种" prop="">
                            <Input placeholder="" v-model="key.currency" readonly></Input>
                        </FormItem>
                        <FormItem label="开卡日期" prop="">
                            <Input placeholder="" v-model="key.signupDate" readonly></Input>
                        </FormItem>
                        <FormItem label="余额" prop="">
                            <Input placeholder="" v-model="key.balance" readonly></Input>
                        </FormItem>
                        <FormItem label="户主名" prop="">
                            <Input placeholder="" v-model="key.houseHolder" readonly></Input>
                        </FormItem>
                        <FormItem label="账户名" prop="">
                            <Input placeholder="" v-model="key.accountName" readonly></Input>
                        </FormItem>
                        <FormItem label="卡牛抓取更新日期" prop="">
                            <Input placeholder="" v-model="key.updateTime" readonly></Input>
                        </FormItem>
                    </Form>
                </div>
            </Panel>
            <Panel name="2">
                数据明细
                <div slot="content">
                    <Form :label-width="120" inline>
                        <Table :columns="recordtwo" :data="record"></Table>
                    </Form>
                </div>
            </Panel>
        </Collapse>
    </Card>
    </div>
</template>

<script>
export default {
  name: 'loan-credit-reporting',
  data () {
    return {
      value1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
      item: null,
      datas: [],
      baseUrl: this.$appContext.marvels_core_approve,
      key: {},
      record: [],
      recordtwo: [
        {
          title: '卡号',
          key: 'cardId'
        }, {
          title: '交易时间',
          key: 'transTime'
        }, {
          title: '支出金额',
          key: 'outcome'
        }, {
          title: '收入金额',
          key: 'income'
        }, {
          title: '币种',
          key: 'currency'
        }, {
          title: '对方账号',
          key: 'targetBankCardNo'
        }, {
          title: '对方账户名',
          key: 'targetBankCardName'
        }, {
          title: '余额',
          key: 'balance'
        }, {
          title: '月份',
          key: 'month'
        }, {
          title: '记账日期',
          key: 'postDate'
        }, {
          title: '交易描述',
          key: 'summary'
        }
      ]

    }
  },
  methods: {
    initpage: function () {
      this.loadCredit()
    },
    // 征信报告
    loadCredit: function () {
      var vm = this
      //  var loanId = this.$route.query.loanId;
      //  var serviceType =this.$route.query.serviceType;
      // //  debugger
      //  var reqNo = this.$route.query.reqNo;
      //  console.log(reqNo,serviceType,loanId);
      var params = {}
      params.loanId = this.$route.query.loanId
      params.serviceType = this.$route.query.serviceType
      params.reqNo = this.$route.query.reqNo

      // console.log(params)
      this.$ajax.get(this.baseUrl + '/approve/process/credit_reporting/service/getCreditDetail', { params: params }).then(re => {
        var data = re.data
        // console.log(data.data.data[0].cardMsg)
        vm.key = data.data.data[0].cardMsg
        vm.record = data.data.data[0].cardDetail
      }).catch(er => {
        // console.log(er)
      })
    }
  },
  created () {
    this.$ajax = this.$util.ajax()
    this.initpage()
    document.getElementsByTagName('title')[0].innerText = '卡牛房贷-核心管理系统'
  },
  //   watch: {
  //     //点击tab页签，加载数据，只加载一次
  //     "taskParams.creditDataMxServiceImpl_detail"(v) {
  //         // debugger
  //     //   if (v) {
  //     //     this.initpage();
  //     //   }
  //     }
  //   },
  props: {
    taskParams: Object
  }
}
</script>

<style lang="less">
.ivu-form-item {
  margin-bottom: 1px;
}
</style>
